<template>
  <div
    class="Container"
    v-if="Options.state"
    :style="{ width: Options.width + 'px' }"
  >
    <MoveBar
      v-if="Options.state"
      v-model:width="Options.width"
      :type="Options.type"
      :limit="Options.limit"
    />
    <div class="Container-Title">
      <div class="Title">
        <div class="Ding">D</div>
        <div class="Text">XXXX</div>
      </div>
      <div class="Close" @click="Options.state = false">X</div>
    </div>
    <div class="Container-Body">
      <slot></slot>
    </div>
  </div>
</template>

<script setup>
import { watch } from "vue";
import MoveBar from "./MoveBar.vue";
const Options = defineModel("Options");
</script>

<style lang="less" scoped>
.Container {
  background-color: #eee;
  .Container-Title {
    height: 48px;
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
    .Close {
      padding: 0 8px;
      height: 48px;
      line-height: 48px;
      text-align: center;
      width: 48px;
      cursor: pointer;
    }
    .Title {
      line-height: 48px;
      display: flex;
      .Ding {
        padding: 0 16px;
      }
    }
  }
}
</style>